package com.pets.springboot_petshop.service.impl;

import com.pets.springboot_petshop.entity.Product;
import com.pets.springboot_petshop.mapper.ProductMapper;
import com.pets.springboot_petshop.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @Author: wxk
 * @Email: 2089967794@qq.com
 * @Date: 2024/10/12 上午11:41 周六
 * @Description: 宠物商品实现类
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;


    @Override
    public Product selectid(int id) {
        return productMapper.selectid(id);
    }

    @Override
    public List<Product> selectpettype_id(String pettype_id) {
        return productMapper.selectpettype_id(pettype_id);
    }

    @Override
    public List<Product> selectname(String name) {
        return productMapper.selectname(name);
    }

    @Override
    public List<Product> selectstate(String state) {
        return productMapper.selectstate(state);
    }

    @Override
    public List<Product> findAll() {
        return productMapper.findAll();
    }

    @Override
    public int add(Product product) {
        return productMapper.add(product);
    }

    @Override
    public int delete(int id) {
        return productMapper.delete(id);
    }

    @Override
    public int update(Product product) {
        return productMapper.update(product);
    }

    @Override
    public int updatestock(Product product) {
        return productMapper.updatestock(product);
    }

    @Override
    public int updatestate(Product product) {
        return productMapper.updatestate(product);
    }

    @Override
    public List<Product> selectrecommend(String recommend) {
        return productMapper.selectrecommend(recommend);
    }

    @Override
    public int batchUpdateStatus(int[] ids, String state) {
        return productMapper.batchUpdateStatus(ids, state);
    }

    @Override
    public int admindelete(int[] ids) {
        return productMapper.admindelete(ids);
    }

    @Override
    public int batchUpdateRecommend(int[] ids, String recommend) {
        return productMapper.batchUpdateRecommend(ids, recommend);
    }
}
